<template>
  <div>
    <h1>Home...</h1>
    <ul class="nav nav-tabs">
      <li><router-link to="/home/news">News</router-link></li>
      <li><router-link to="/home/message">Message</router-link></li>
    </ul>
    <router-view />
  </div>
</template>

<script>
export default {
  name: "Home",
  mounted() {
    console.log("home mounted");
  },
  beforeDestroy() {
    console.log("home beforeDestroy");
  },
  // 两个生命周期：只有被keep-alive缓存的组件生效
  // 激活（缓存组件加载时）
  activated() {
    console.log("home activated");
  },
  // 未激活（缓存组件不加载时）
  deactivated() {
    console.log("home deactivated");
  },
};
</script>

<style>
</style>